const http = require("http");

let options= {
    hostname: "192.168.42.166",
    port: 3000,
    path: "/login",
    method: "POST"
}

let req = http.request(options , (res) => {
    let str = '';
    res.on("data" , (chunk) => {
        str += chunk;
    })
    res.on("end" , () => {
        console.log(str);
    })
})

let obj = {};
obj.username = process.argv[2];
obj.password = process.argv[3];

req.write(JSON.stringify(obj));
req.end();